package binarySearchTree;

import binarySearchTree.BinarySearchTree;

public class Test {

    public static void main(String[] args) {
        BinarySearchTree binarySearchTree = new BinarySearchTree();
        int[] array = {10,4,29,35,18,27,5,13};
        for (int i = 0; i < array.length; i++) {
            binarySearchTree.insert(array[i]);
        }
        System.out.print("查找：");
        BinarySearchTree.TreeNode node = binarySearchTree.search(105);
        try {
            System.out.println(node.key);
        }catch (NullPointerException e) {
            System.out.println("没有你要查找的数据!");
        }
    }
}
